import { useCallback, useState } from "react";
const Son = (props) => {
    console.log('**-*-*-*-*-')
  return (
    <div>
      我是子组件
      <button onClick={props.handleClick}>++</button>
    </div>
  );
};
const App = () => {
  const [count, setCount] = useState(1);
  const handleClick = useCallback((event) => {
    console.log(event);
    setCount(1);
  }, [count]);
  return (
    <div>
      {count}
      <Son handleClick={handleClick}></Son>
    </div>
  );
};
export default App;
